package com.ozo.boot.auth.pojo.dto;

import com.ozo.boot.auth.constant.SmsTypeEnum;
import com.ozo.boot.auth.token.LoginType;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 用户 登录对象
 * </p>
 *
 * @author qiangesoft
 * @since 2024-07-11
 */
@Data
@Schema(description = "用户登录对象")
public class LoginDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "用户名不能为空", groups = AccountLogin.class)
    @Schema(description = "用户名")
    private String username;

    @NotBlank(message = "密码不能为空", groups = AccountLogin.class)
    @Schema(description = "密码")
    private String password;

    @NotBlank(message = "验证码不能为空", groups = AccountLogin.class)
    @Schema(description = "验证码")
    private String captcha;

    @NotBlank(message = "验证码uuid不能为空", groups = AccountLogin.class)
    @Schema(description = "验证码uuid")
    private String captchaUUID;

    @NotNull(message = "记住我不能为空", groups = AccountLogin.class)
    @Schema(description = "记住我")
    private Boolean rememberMe;

    @NotBlank(message = "手机号不能为空", groups = {PhoneLogin.class, SendSms.class})
    @Schema(description = "手机号")
    private String mobile;

    @NotNull(message = "类型不能为空", groups = SendSms.class)
    @Schema(description = "类型：LOGIN-登录 REGISTER-注册")
    private SmsTypeEnum smsType;

    @NotBlank(message = "短信验证码不能为空", groups = PhoneLogin.class)
    @Schema(description = "短信验证码")
    private String smsCode;

    @Schema(description = "认证方式")
    private LoginType grantType;

    public interface AccountLogin {
    }

    public interface SendSms {
    }

    public interface PhoneLogin {
    }

}
